package com.sky.controller.admin;

import com.sky.config.GlobalStatus;
import com.sky.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/admin/shop")
@Api("店铺相关接口")
public class ShopController {
    @ApiOperation("设置营业状态")
    @PutMapping("/{status}")
    public Result setStatus(@PathVariable Integer status){
        GlobalStatus.setStatus(status);
        return Result.success();
    }
    @ApiOperation("获取营业 状态")
    @GetMapping("/status")
    public Result getStatus(){
        return Result.success(GlobalStatus.getStatus());
    }

}
